<?php


namespace plugin\coupon\app\task;


use app\api\logic\CouponLogic;
use support\contract\ITask;
use Workerman\Crontab\Crontab;

class CouponTask implements ITask
{

    public function start()
    {
        // 每天执行一次
        //'0 2 * * * *'
        new Crontab('0 2 * * * *', function () {
            $logic = new CouponLogic();
            $logic->expiredUsersCoupon();
            $logic->expiredCoupon();
        });
    }
}